<?php
/**
 * loggeduser controller
 * @package app-member_controller
 */
load_controller('/memberbase');
/**
 * loggeduser controller
 * @author pandajingjing
 * @package app-member_controller
 */
abstract class loggedusercontroller extends memberbasecontroller{
	
	/**
	 * 登录用户信息
	 * @var array
	 */
	protected $_arrUserInfo=array();

	/**
	 * 在控制器开始时执行（调度使用）
	 */
	function beforeRequest(){
		parent::beforeRequest();
		//do something
		$strAuthCode=$this->getParam('mauthcode','c');
		if(null==$strAuthCode or ''==$strAuthCode){
			load_controller('/login');
			$this->redirectURL(logincontroller::getURL());
		}
		load_lib('/bll/member/base');
		$clsBll=new bll_member_base();
		$arrUserInfo=$clsBll->decryptLoginInfo($strAuthCode);
		if(isset($arrUserInfo['USERID'])){
			$this->_arrUserInfo=$arrUserInfo;
			$this->setData('arrUserInfo',$arrUserInfo);
		}else{
			load_controller('/login');
			$this->redirectURL(logincontroller::getURL());
		}
	}
	
	/**
	 * 获取登录用户信息
	 * @return array
	 */
	function getUserInfo(){
		return $this->_arrUserInfo;
	}
	
}